function pageThroughMaps(himg)
% pageThroughMaps
%
% Editing: gs 2004
% gs may 2005 - private version for mapAverager1p0
% ---------------------------------------------------------------------
% assumes data have been stored appropriately in image's UserData field

data = get(gco, 'UserData');
[r,c,p] = size(data.maps);

if data.currentNum ~= p
    data.currentNum = data.currentNum + 1;
elseif data.currentNum == p
    data.currentNum = 1;
end
set(himg, 'UserData', data);

set(himg, 'CData', data.maps(:,:,data.currentNum));
% name = data.cellNames(data.currentNum, :);
% title(data.cellNames(data.currentNum, :));
title(data.cellNames{data.currentNum});
colorbar;


% plot the soma position
hold on;
hsoma = findobj(get(gca, 'Children'), 'Tag', 'soma marker');
n = data.currentNum;
if strcmp(data.cellType{n}, 'pyramidal')
    marker = '^';
elseif strcmp(data.cellType{n}, 'stellate')
    marker = 'pentagram';
elseif strcmp(data.cellType{n}, 'interneuron')
    marker = 'o';
else
    marker = 'square';
end
set(hsoma, 'XData', data.X(n), 'YData', data.Y(n), ...
    'Marker', marker, 'MarkerEdgeColor', 'k', 'MarkerFaceColor', 'w', 'MarkerSize', 6);
